package com.copa.l709;

/**
 * @author copa
 * @createDate 2022-09-02 12:17
 * @function ascii码转换法
 */
public class Test2 {

    /**
     * 小写字母 97-122 a-z
     * 大写字母 65-90  A-Z
     * @param s
     * @return
     */
    public String toLowerCase(String s) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            sb.append(c >= 65 && c <= 90 ? (char)(c + 32) : c);
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        String s = "Hello";
        System.out.println(new Test2().toLowerCase(s));
    }
}
